package cz.rosada.sx.library;

import java.io.Serializable;

public class Progress implements Serializable {
	private static final long serialVersionUID = 2884787094536562081L;

	private int mValue;

	private int mMax;

	public int getMax() {
		return Math.max(mMax, 0);
	}
	public void setMax(int max) {
		mMax = max;
	}
	public int getValue() {
		return Math.max(0, Math.min(mValue, mMax));
	}
	public void setValue(int value) {
		mValue = value;
	}
	public boolean isFinished() {
		return mValue >= mMax;
	}
	public void addValue(int offset) {
		setValue(mValue + offset);		
	}
	public void addMax(int offset) {
		setMax(mMax + offset);		
	}
	
}
